<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box {
            display: flex;

            /* 修改主轴方向，垂直方向：侧轴自动变换到水平方向 */
            flex-direction: column;

            /* 主轴在垂直，视觉效果：垂直居中 */
            justify-content: center;

            /* 侧轴在水平，视觉效果：水平居中 */
            align-items: center;

            width: 150px;
            height: 120px;
            background-color: pink;
        }

        img {
            width: 32px;
            height: 32px;
        }
    </style>
</head>
<body>
    <div class="box">
        <img src="https://qiniu.777nx.cn/avatar.webp" alt="">
        <span>蜡笔小新</span>
    </div>
</body>
</html>